package com.my12306.train.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.common.model.vo.PageVo;
import com.my12306.train.model.entity.CarriageEntity;
import com.my12306.train.model.entity.PlanEntity;
import com.my12306.train.model.vo.PlanParamsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 路线计划
 *
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
@Mapper
public interface PlanDao extends BaseMapper<PlanEntity> {
    /**
     * 分页查询
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    List<PlanEntity> queryPlanPage(@Param("pageVo") PageVo pageVo, @Param("logicDelete") int logicDelete);

    /**
     * 分页查询总数
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    Integer queryPlanCount(PageVo pageVo, Integer logicDelete);

    /**
     * 根据ids批量删除计划
     *
     * @param trainIds
     * @param logicDelete
     */
    void deletePlanBatchByIds(@Param("list") List<Long> trainIds, @Param("logicDelete") Integer logicDelete);

    /**
     * 查询所有计划
     * @param logicDelete
     * @return
     */
    List<PlanEntity> queryAllPlan(@Param("logicDelete") int logicDelete);

    List<String> getStationNameList(@Param("routeId") String routeId,@Param("logicDelete") int logicDelete);

    /**
     * 获取参数
     * @param trainCode
     * @param logicDelete
     * @return
     */
    List<PlanParamsVo> getPlanParameters(@Param("trainCode") String trainCode, @Param("logicDelete") int logicDelete);

    /**
     * 获取某个车次的所有车厢
     * @param trainCode
     * @param logicDelete
     * @return
     */
    List<CarriageEntity> queryCoachByTrainCode(@Param("trainCode") String trainCode,@Param("logicDelete") Integer logicDelete);
}
